
#ifndef  BREAKPOINTSERVICE_H
#define  BREAKPOINTSERVICE_H
#include <string>
#include <ostream>


class IBreakPoint;

class BreakPointService {
public:
    BreakPointService();
    ~BreakPointService();

    int start();
    int stop();

    int connected();
    int disconnected();

    int receivedLoginResp(const char * msg);
    int receivedNormalResp(const char * msg);
    int receivedBreakPointResp(const char * msg);

    int timeout();

    //for test
    int getStatus() const {return status;}
    bool isEndStatus() const { return status == END;}
    bool isInitedStatus() const { return status == INITED;}
    bool isConnectedStatus() const { return status == CONNECTED;}
    bool isLoginedStatus() const { return status == LOGINED;}
    bool isDisconnectedStatus() const { return status == DISCONNECTED;}

private:
    static const int END = 0;
    static const int INITED = 1;
    static const int CONNECTED = 2;
    static const int LOGINED = 3;
    static const int DISCONNECTED = 4;

private:
    int sendMessage(const char * msg);
    std::ostream &  logStatus(std::ostream & out);

private: 
    int status;
    IBreakPoint * breakPoint;
};

#endif   /* BREAKPOINTSERVICE_H */
